<template>
   <div class="box" >
      <span class="todayGuest">今日访客</span>
      <div class="top">
         <img src="https://img.axureshop.com/ee/00/de/ee00de2201bf478bb4a9d4f881afd706/images/首页/u55.png" class="top-img">

         <div class="top-left">
            <img src="https://img.axureshop.com/ee/00/de/ee00de2201bf478bb4a9d4f881afd706/images/访客审核列表-全部/u1904.png"
               style="width:84px;z-index: 9999; height:84px">
         </div>
         <div class="top-center"  >
            <div class="name">刘小牛</div>
            <div class="phone">18825636952</div>
            <div class="time">2019-12-15  20:00:00</div>
         </div>
         <div class="top-right">
            <span class="rightTitle">待访问</span>
            <a href="#">
               <van-icon name="upgrade" color="#F8AFE6" size="20px" @click="pushclick" />
            </a>
         </div>

         <img src="https://img.axureshop.com/ee/00/de/ee00de2201bf478bb4a9d4f881afd706/images/首页/u56.png"
            class="bottom-img">
      </div>
      <div class="container">
         <span class="todayGuest">全部访客</span>
         <div class="box-2">
            <div class="bottom-top">
               <van-row>
                  <van-col span="2">序</van-col>
                  <van-col span="5">访客姓名</van-col>
                  <van-col span="6">访客日期</van-col>
                  <van-col span="5">状态</van-col>
                  <van-col span="5">查看</van-col>

               </van-row>
            </div>
            <div class="bottom-content">
               <van-row v-for="(item,index) in tabledata" :key="index">
                  <van-col span="2">{{ item.id }}</van-col>
                  <van-col span="5">{{ item.name }}</van-col>
                  <van-col span="6">{{ item.time }}</van-col>
                  <van-col span="5"> {{ item.statu }}</van-col>
                  <van-col span="5">查看</van-col>
               </van-row>
            </div>
         </div>
      </div>
   </div>
</template>

<script setup>
import { allGuestApi, adminTodayApi } from '@/api/adminAPi'
import { useRouter } from 'vue-router';
import adminStore from '@/store/admin'
import { ref, onMounted, onBeforeMount } from 'vue'
const myadminStore = adminStore()
const router = useRouter();

const total = ref(0)
const tabledata = ref(['123',
   '156'])
const spanRef = ref()
let adminToday = ref([])

onBeforeMount(async () => {
   myadminStore.setUserInfo(false)
   let ret = await allGuestApi()
   if (ret.code === 0) {
      total.value = ret.total
      tabledata.value= ret.data
   }
})


</script>
<style scoped lang="scss">
.box {
   padding-top: 10px;
}

.todayGuest {
   font-size: 15px;
   font-family: "微软雅黑";
   color: #3C3B3D;
   margin-left: 12px;
   font-weight: bold;
}

.top {
   box-shadow: 0px 2px 10px rgba(102, 102, 102, 0.137254901960784);
   top: 10px;
   width: 345px;
   height: 120px;
   margin: 0 auto;
   display: flex;
   position: relative;
}

.top-left {
   display: flex;
   justify-content: center;
   align-items: center;
}

.top-center {
   margin-top: 18px;
   z-index: 999;
   height: 84px;

   .name {
      font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
      font-size: 16px;
      color: white;
      font-weight: bold;
      height: 28px;
   }

   .time,
   .phone {
      font-size: 14px;
      color: gray;
      font-family: '微软雅黑';
      height: 28px;

   }
}

.top-right {
   width: 110px;
   display: flex;
   justify-content: center;
   align-items: center;

   .rightTitle {
      font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
      font-weight: 700;
      font-style: normal;
      font-size: 16px;
      color: #F89AD8;
      text-align: right;
   }
}

a {
   .van-icon {
      transform: rotate(90deg);
      margin-left: 5px;
      font-weight: bold;
   }
}

.top-img {
   border-width: 0px;
   position: absolute;
   top: -10px;
   left: -10px;
   width: 200px;
   height: 65px;
}

.bottom-img {
   border-width: 0px;
   position: absolute;
   right: -12px;
   bottom: -12px;
   width: 135px;
   height: 70px;
}

.container {
   width: 355px;
   margin: 0 auto;
}

.span-fen {
   padding: 5px;
   background-color: #F89AD8;
   border-radius: 5px;
   color: white;
}

.span-blue {
   padding: 5px;
   background-color: #6CB6FF;
   border-radius: 5px;
   color: white;
}

.container {
   display: flex;
   flex-direction: column;
   min-height: 100vh;

   .box-2 {
      padding: 10px;
      flex: 1;

      .bottom-top {
         position: sticky;
         top: 0;
         background-color: #f7f3f3;

         div {
            height: 50px;
            display: flex;
            align-items: center;
            z-index: 1;
            opacity: 1;

            .van-icon {
               transform: scaleX(-1);
            }

            // span {

            //    width: 30px;
            //    font-size: 14px;
            //    // font-weight: 600;
            // }
         }

         .van-row {
            width: 335px;
            background-color: #6CB6FF;
            border-radius: 5px 5px 0 0;
            font-size: 14px;
            color: white;
            position: sticky;
            top: 60px;
            z-index: 3;

            :deep(.van-col) {
               display: flex;
               justify-content: center;
               align-items: center;
            }
         }
      }

      .bottom-content {
         .van-row {
            font-size: 14px;
            color: black;
            height: 50px;
            // font-weight: 500px;

            :deep(.van-col) {
               display: flex;
               justify-content: center;
               align-items: center;
            }

            &:nth-child(even) {
               background-color: #E9F4FF;
            }
         }
      }
   }

}
</style>
